package com.jerei.web.plugin.api;

import org.springframework.ui.Model;
import ro.fortsoft.pf4j.ExtensionPoint;
import ro.fortsoft.pf4j.Plugin;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.lang.reflect.InvocationTargetException;

/**
 * Created by sunfeihu on 2016/11/23.
 */
public interface IController extends ExtensionPoint {

    public Object get(HttpServletRequest request, HttpServletResponse response, Model model, String op, Plugin plugin) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException;

    public Object post(HttpServletRequest request, HttpServletResponse response, Model model, String op, Plugin plugin) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException;

    /**
     * 是否拥有操作
     *
     * @param op
     * @return
     */
    public Boolean haveMethod(String op);
}